//
//  SWHDetailBottomView.swift
//  GreenDeal
//
//  Created by Moennig Q on 2023/11/7.
//


import UIKit
class SWHDetailBottomView: View {
    //bottons左右边距，及中间讲个 间距
    let btnSize = CGSize(width: 100, height: 40)
    //
    var barcodeBtn: PVDsListCellOperButton!
    var checklistBtn: PVDsListCellOperButton!
    override func setUpView() {
        //阴影部分
        self.backgroundColor = UIColor(red: 0.98, green: 0.98, blue: 0.98, alpha: 1)
        self.drawCorner(byRoundingCorners: [.topLeft,.topRight])
        self.layer.cornerRadius = 9
        self.layer.shadowOffset = CGSize(width: 0, height: -2)
        self.layer.shadowColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.2).cgColor
        self.layer.shadowOpacity = 1
        self.layer.shadowRadius = Constant.BackViewCornerRadius
        self.clipsToBounds = false//这里必须设置为false，因为设置为true会把（drawCorner中设置为true了）上边设置的阴影切掉
        let internalMargin: CGFloat = (APPConfig.WidthForPortrait - btnSize.width * 2) / 3
        //1.barcode
        barcodeBtn = PVDsListCellOperButton()
        self.addSubview(barcodeBtn)
        barcodeBtn.snp.makeConstraints { make in
            make.top.equalTo(15)
            make.left.equalTo(internalMargin)
            make.size.equalTo(btnSize)
            make.bottom.equalTo(self.safeAreaLayoutGuide.snp.bottom).offset(Constant.BottomMargin)
        }
        //2.checklist
        checklistBtn = PVDsListCellOperButton()
        self.addSubview(checklistBtn)
        checklistBtn.snp.makeConstraints { make in
            make.right.equalTo(-internalMargin)
            make.top.size.equalTo(barcodeBtn)
        }
    }
}
